﻿/*
#------------------------------------------------------------------------------
#-- View Name:		[dbo].[vwWH_LogOverview_Details]
#-- Purpose:		Used to review the status of maintenance
#--	Last Update:	09/03/2014
#--					For a complete history - please review comments in Source Control
#------------------------------------------------------------------------------
*/
CREATE VIEW [dbo].[vwWH_LogOverview_Details]
AS

SELECT		DATENAME(dw, CAST(CONVERT(varchar(20), mnt.[mnt_action_date], 112) as datetime)) [date_name],
			ssd.[ssd_sqlserver_name_ro],
			CAST(CONVERT(varchar(20), mnt.[mnt_action_date], 112) as datetime) [mnt_action_date],
			mnt.[mnt_action_type],
			mnt.[mnt_success],
			COUNT(*) row_count
FROM		[dbo].[tblWH_Log] mnt (NOLOCK)
JOIN		[dbo].[tblMSX_server_discovery] ssd ON mnt.mnt_server_ssd_id = ssd.ssd_id
GROUP BY	ssd.[ssd_sqlserver_name_ro],
			CAST(CONVERT(varchar(20), mnt.[mnt_action_date], 112) as datetime),
			mnt.[mnt_action_type],
			mnt.[mnt_success]
